// ml:run = $bin < input
// ml:opt = 0
// ml:ccf += -g
#include <iostream>
#include <algorithm>
#include <vector>

using ll = long long;
int const limit = 2000;
ll n, s;

namespace bipartite_graph
{
	int const maxn = 5008;
	typedef std::vector<int> edge_type;
	typedef std::vector<int>::iterator edge_iter;
	typedef std::vector<edge_type> graph_type;

	graph_type graph;
	edge_type linked;
	bool vis[maxn];
	int n, half;

	void init(int tn, int thalf)
	{
		n = tn; half = thalf;
		graph.clear();
		graph.resize(n);
		linked.clear();
		linked.resize(n);
		std::fill(vis, vis + n, false);
	}

	void add_edge(int u, int v)
	{
		graph[u].push_back(v); graph[v].push_back(u);
	}

	bool hungarian_dfs(int u)
	{
		for (edge_iter it = graph[u].begin(); it != graph[u].end(); ++it) {
			int v = *it;
			if (vis[v]) continue;
			vis[v] = true;
			if (linked[v] == -1 || hungarian_dfs(linked[v])) {
				linked[u] = v;
				linked[v] = u;
				return true;
			}
		}
		return false;
	}

	int max_match()
	{
		std::fill(linked.begin(), linked.end(), -1);
		int ret = 0;
		for (int i = 0; i < half; i++) {
			std::fill(vis, vis + n, false);
			if (hungarian_dfs(i)) ret++;
		}
		return ret;
	}
};

int main()
{
    std::ios_base::sync_with_stdio(false);
    int T; std::cin >> T;
    for (int ti = 1; ti <= T; ti++) {
        std::cout << "Case #" << ti << ": ";
        std::cin >> n >> s;
        /* [1, n] [s + 1, s + n] */
        if (n >= s + 1) {
            auto tmp = n;
            n = s;
            s = tmp;
        }
        if (!n) { std::cout << "Yes\n"; continue; }
        if (n > limit) { std::cout << "No\n"; continue; }

        bipartite_graph::init(2 * n, n);
        for (int i = 1; i <= n; i++)
            for (int j = 1; j <= n; j++) {
                if ((s + j) % i) continue;
                bipartite_graph::add_edge(n + j - 1, i - 1);
            }
        int match = bipartite_graph::max_match();
        if (match != n) std::cout << "No\n";
        else std::cout << "Yes\n";
    }
}

